package com.jiyun.controller;

import com.jiyun.entity.day09.SjDTO1;
import com.jiyun.feign.SjFeign;
import com.jiyun.vo.ResultResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Title: SjController
 * @Author 杜瑞
 * @Date 2023/9/1 10:58
 */
@RestController
@RequestMapping("sj")
public class SjController {
    @Autowired
    private SjFeign sjFeign;

    @RequestMapping("findAll1")
    public ResultResponse findAll1(@RequestBody SjDTO1 sjDTO1){
        try {
            ResultResponse all1 = sjFeign.findAll1(sjDTO1);
            return ResultResponse.success(all1);
        } catch (Exception e) {
            e.printStackTrace();
            return ResultResponse.error();
        }
    }

    @RequestMapping("findAllDate")
    public ResultResponse findAllDate(@RequestBody SjDTO1 sjDTO1){
        try {
            ResultResponse allDate = sjFeign.findAllDate(sjDTO1);
            return ResultResponse.success(allDate);
        } catch (Exception e) {
            e.printStackTrace();
            return ResultResponse.error();
        }
    }

    @RequestMapping("findAllMax")
    public ResultResponse findAllMax(@RequestBody SjDTO1 sjDTO1){
        try {
            ResultResponse allMax = sjFeign.findAllMax(sjDTO1);
            return ResultResponse.success(allMax);
        } catch (Exception e) {
            e.printStackTrace();
            return ResultResponse.error();
        }
    }
}
